home *** CD-ROM | disk | FTP | other *** search
/ Adventures with Oslo: Tools & Gadgets / Adventures with Oslo - Tools and Gadgets.ISO / mac / Ad / Mod03 / cavegame.Dir / 00051.ls < prev    next >
Encoding:
Text File  |  1994-09-25  |  1.1 KB  |  48 lines

  1. on startMovie
  2.   set HC to the number of cast "handCursor"
  3.   cursor([HC, HC + 1])
  4. end
  5.  
  6. on mouseUp
  7.   if (the castNum of sprite the clickOn >= 2) and (the castNum of sprite the clickOn <= 19) then
  8.     set icon to the clickOn
  9.     set placed to 0
  10.     repeat with i = 20 to 37
  11.       if sprite icon intersects i then
  12.         set the locH of sprite icon to the locH of sprite i + 40
  13.         set the locV of sprite icon to the locV of sprite i + 14
  14.         updateStage()
  15.         set placed to 1
  16.       end if
  17.     end repeat
  18.     if not placed then
  19.       set the locH of sprite icon to 600
  20.       updateStage()
  21.     else
  22.       checkLocs()
  23.     end if
  24.   end if
  25. end
  26.  
  27. on checkLocs
  28.   global gBackPack
  29.   set allGood to 1
  30.   repeat with i = 2 to 19
  31.     if the locH of sprite i <> word i - 1 of field "hlocs" then
  32.       set allGood to 0
  33.     end if
  34.     if the locV of sprite i <> word i - 1 of field "vlocs" then
  35.       set allGood to 0
  36.     end if
  37.   end repeat
  38.   if allGood then
  39.     repeat with i = 2 to 19
  40.       set the cursor of sprite i to 0
  41.     end repeat
  42.     if getOne(gBackPack, #prize) = 0 then
  43.       add(gBackPack, #prize)
  44.     end if
  45.     go("win")
  46.   end if
  47. end
  48.